define(function(require, exports, module) {
  'use strict';

  module.exports = function(data) {
    return [{
      label: '问题标题',
      attrs: {
        type: 'text',
        name: 'docSubject',
        value: data ? data.docSubject : '',
        //pattern: '^[^\\/]+$',
        maxlength: 20,
        required: 'required',
        'data-role': 'title'
      }
    }, {
      label: '问题分类',
      attrs: {
        type: 'text',
        name: 'cateIds',
        placeholder: '选择分类',
        value: data ? data.cateIds : '',
        required: 'required',
        maxlength: 30
      }
    }, {
      label: '问题内容',
      attrs: {
        type: 'multiline',
        name: 'desc',
        value: data ? data.desc : '',
        maxlength: 50
      }
    }, {
      label: '相似问题',
      attrs: {
        type: 'hidden',
        id: 'similar',
        maxlength: 200
      }
    }, {
      label: '问题答案',
      attrs: {
        type: 'multiline',
        id: 'descAnswer',
        name: 'descAnswer',
        value: data ? data.descAnswer : '',
        maxlength: 200
      }
    }, {
      label: '信息来源',
      attrs: {
        type: 'text',
        id: 'infoLink',
        name: 'infoLink',
        value: data ? data.infoLink : '',
        maxlength: 200
      }
    }];
  };
});
